home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / misc / lise20.lha / lise2.0 / mdl / src / test.mdl < prev    next >
Text File  |  1993-03-31  |  3KB  |  112 lines

  1. NAME{DirUtil}
  2. SIZE{450,150,5}
  3. NEW_MENU{File}
  4. MENU{info}{!List $source}
  5. MENU{delete}{!Delete $source}
  6. MENU{rename}{!Rename $source $STRINGBOX{enter new name}}
  7. MENU{make executable}{chmod +x $source}
  8. MENU{make Read Only}{chmod -w $source}
  9. MENU{make Write enable}{chmod +w $source}
  10. MENU{copy}{cp $source $destination}
  11. MENU{exit}{$EXIT}
  12. NEW_MENU{dirs}
  13. MENU{source: dir all}
  14.    {
  15.    a=$source
  16.    b=`dirname $a`
  17.    ll $b
  18.    }
  19. MENU{source: dirs only}
  20.    {
  21.    a=$source
  22.    b=`dirname $a`
  23.    ll $b | grep '<Dir>'
  24.    }
  25. MENU{dest.: dir all}{ll $HOME/$destination}
  26. MENU{dest.: dirs only}
  27.    {
  28.    ll destination | grep '<Dir>'
  29.    }
  30. MENU{copy}
  31.    {
  32.    a=$source
  33.    b=`dirname $a`
  34.    cp $b/* $destination
  35.    }
  36. MENU{statistics}{!Info}
  37. MENU{make dir}{a=$STRINGBOX{enter path} ; mkdir $a}
  38. MENU{remove dir}
  39.    {
  40.    a=$STRINGBOX{y to remove from SOURCE.}
  41.    b=$source ; if [ $a = y ] ; then rm -r $b/* ; rmdir $b  ; fi 
  42.    }
  43. NEW_MENU{extras}
  44. MENU{execute}{run $source}
  45. MENU{ed}{runback c:ed $source}
  46. MENU{compile (c)}
  47.    {
  48.    a=$source
  49.    b=`strhead $a .c`
  50.    cc -o $b $a
  51.    }
  52. MENU{nonsense}{runback c:mdl nonsense.mdl}
  53. MENU{exit}{$EXIT}
  54. NEW_MENU{help}
  55. MENU{whodidit}
  56.    {
  57.    echo "This is a demo program for the menu description language mdl."
  58.    echo "mdl and this demo are written by"
  59.    echo "                                      Rainer Kowallik"
  60.    echo "Give Amiga power to UNIX and UNIX power to the Amiga"
  61.    }
  62. MENU{about mdl}
  63.    {
  64.    echo "mdl is the Menu Description Language for UNIX."
  65.    echo "This was designed to keep the programmers head free of"
  66.    echo "all the time consuming Xwindow toolkit and motif overhead,"
  67.    echo "without having users complaining that the MacIntosh and Amiga"
  68.    echo "are so much more comfortable. Of course, such approach can"
  69.    echo "not cover 100% of all cases, but you will be able to solve"
  70.    echo "about 70% of the problems with this method, leaving the"
  71.    echo "rest to the decreasing intelligence of the user."
  72.    echo "Stupidity should be punished anyway."
  73.    echo "for more information read /src/mdl/mdl.doc"
  74.    }
  75. MENU{about dirutil}
  76.    {
  77.    echo "This directory utility was written as an example program"
  78.    echo "for MDL. I know, that there are much better ones around"
  79.    echo "(at least for the Amiga), but if you dont have any, than"
  80.    echo "this will be good enough."
  81.    echo "File operations are allways performed on the SOURCE"
  82.    echo "If further information is needed, it is read from DESTINATION"
  83.    echo "You must allways set these parameters before calling any"
  84.    echo "function. When you have set one parameter correctly, you will"
  85.    echo "get a message, that DIRUTIL has recognized your selection."
  86.    echo "DESTINATION must allways be in your HOME directory."
  87.    echo "This should prevent you from accidently copying random"
  88.    echo "files into random directories."
  89.    echo "only the Superuser has access to all directories as destination."
  90.    }
  91. MENU{read doc}{runback c:ed mdl.doc}
  92. NEW_MENU{.          by RAKO}
  93. TOGGLE{250,10,confirmation-off}{conf}
  94. FILE_SELECT{5,20,source}
  95.    {source}
  96.    {
  97.    if [ $conf = 0 ]
  98.      then
  99.      echo you selected file:
  100.      echo $source
  101.    fi
  102.    } 
  103. SELECTION{250,20,destination,users,usr,etc,bin,usr/bin/X11}
  104.    {destination}
  105.    {
  106.    if [ $conf = 0 ]
  107.       then
  108.       echo destination is:
  109.       echo $destination
  110.    fi
  111.    }
  112.